#include <stdio.h>

int main()
{
    char str[100] = "melody";
    char str1[100] = " ";
    int i = 0;

    while (str[i] != '\0')
    {

        i++;
    }
    int j = 0;
    while (i)
    {
        --i;
        ++j;
        printf("%c\n", str[i]);
        str1[j] = str[i];
    }
    printf("%s\n", str1);
    return 0;
}